import pandas as pd
import numpy as np
from pandas.core import strings
data = pd.read_csv('./data_EEMDV2.csv')


def k_means_sum(nums):
    for i in range(len(nums)):
        data['imf'+str(i)] = data[nums[i]].sum(axis=1)
        print(data)
    data.to_csv('data_EEMDV2_9.csv', columns=[
                'imf0', 'imf1', 'imf2', 'imf3', 'imf4', 'imf5','imf6','imf7','imf8'], header=True, index=True, index_label='order')


k_means_sum([
    [ '7' ],
  [ '10' ],
  [ '1', '2', '8' ],
  [ '12' ],
  [ '3' ],
  [ '11' ],
  [ '0' ],
  [ '5' ],
  [ '4', '6', '9' ]
])
